//
//  Colors.swift
//  WNLockDemo
//
//  Created by 裴威 on 31/08/2018.
//  Copyright © 2018 wunu. All rights reserved.
//

import UIKit

typealias Colors = UIColor
extension UIColor {
    
    /// create color by hex
    ///
    /// - Parameters:
    ///   - hex: 0x~
    ///   - alpha: default 1
    convenience init(hex: Int, alpha: CGFloat = 1) {
        self.init(
            red: CGFloat((hex >> 16) & 0xff) / 255.0 ,
            green: CGFloat((hex >> 8) & 0xff) / 255.0,
            blue: CGFloat(hex & 0xff) / 255.0,
            alpha: alpha
        )
    }
}

// MARK: - App 颜色主题相关
extension Colors {
    /// 主题色
    static let main = UIColor(hex: 0x4084ff)
    /// 辅助色
    static let accessory = UIColor(hex: 0xf06352)
    /// 可点击/带链接
    static let active = UIColor(hex: 0x576b95)
    /// title颜色
    static let title = UIColor(hex: 0x222222)
    /// 次要信息/标签
    static let label = UIColor(hex: 0x999999)
    /// 提示信息
    static let alert = UIColor(hex: 0xc7c7c7)
    /// 分割线颜色
    static let separator = UIColor(hex: 0xdcdcdc)
    /// 背景颜色
    static let background = UIColor(hex: 0xf5f5f5)
    
}
